Refactor server API calls into a module

There is one spot still leaking a little bit of API details (atmosphere/websocket request) but this is good first step towards maintainability. In the future, updates to support server changes will most likely be isolated to the API module.