Converting to restful API