Started adding tests

Started reorganising the structure of the project, all api json stuff
will be in either private or public api files.