Refactored code within api_base

Multiple backend changes to improve the API. Includes better
documentation of code, and improvements to how it processes the API
call. DEFAULT_FORMAT now actually does something (from settings.py).