8 add tests to api

## Adding tests for the API
This is in preparation for re-factoring some parts of the API, see issue #8 for more information.
*Note to reviewer*: As usual there are some Django magic and also some Tastypie (rest framework) specific things going on here. Let me know if you want more comments to explain this.
 
Reviewer: @joachimmetz
Now it is a frozenset. I'm unsure about making this a class value, I think that may make the code less intuitive? Same for the other comments below.