restful api, database redesign