Test full flow

Adds test cases to verify the full functionality of the web service and contains several bug fixes in relation to the Middleware
Can we remove this for now? It is addressed in #12