Extracts the database calls from the controller to the model. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>