Removing dependency on request from JSON endpoint