Improvements on basic document crud api.
Improved invalid json error reporting.
Initial work on documents create http api and tests for all existing http api.