DRY and make more readable the api responses.