Setting up a cleaner env and writing API endpoints