There is no error checks in models so every e.g. database error shows as an internal server error or a gateway error to the user. There should be a "try-except" block to catch errors and return informative error message to the user can continue working without need to press "back" -button.