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
Needs file header, but I'm also not sure why it thinks this was a move...