production endpoint and some bug fixes