made the api more restful