restapi is shaping up, now I need to clean it up and add error handling