Moving api functions out of api.models to api.get and api.post