Designing a RESTful API to interact with a PostgreSQL database