implement new api system

api.views contains code related to http response only, business logic is
in api.core