change the api to be more restful