Solution for the backend challenge