starting to build basic front-end js framework. adding better to_api and json returns