Json api

Adds a JSON API to the project, which I will shortly transform into an HTTP API so that file transfer works in the most straightforward manner possible.