basic RESTful api implementation