Implement all rest api endpoints.