The documentation is out of sync with the code base - apologies for this. Things are moving pretty quick and it's difficult to keep up with the changes!
Have a look at the trader-demo code. Specifically:
Api implementations no longer take a
ServiceHub object, instead they require a
CordaRPCOps object. This is because API server was changed to depend on the RPC framework, instead of accessing the node's persistence layer directly.
Looking at the trader-demo code should give you a good idea on how to integrate attachments into your code. Let us know if you need any further assistance.