adding restful api for models