Setting up code to support as a service