changed all json output returns to constants defined in main.db