#1 Further work on REST API. Added correct json support, access to individual documents, sorting, limits and offset syntax. Also separated restresource into separate module and reorganised API package files. Incorporated a set of unittests to tests apiutils.