Refactor and decouple REST api framework

The recording API endpoints have been moved from the server.py module to a new class called recording.py.
You can simplify a lot of the code below looping over both key and value.

```python
for key, value in your_dict.iteritems():
    ....
```