Added datetime handler to /api/ endpoint