API: Clean up JSON response serialization