api decorator renamed to does_json
Added some more structure
Added some comments and todos