Refactoring to json api

Deleted static pages, some actions are refactored to JSON, some are kept as they was for testing purposes, as we don't have any other UI right now, and I don't know an easy way to  POST a request to server. Models were moved to separate file, and config for DB was also changed.