switched to function-based views for the api