refactor route building for restful api into class