error handling is completely missing. please see the comment on the controller part at the top