Adding the beginning of the JSON API and working more on the server flow