Backend: Allow custom metrics endpoint to accept axios requests
This is a part of enhancing the Edit custom metrics feature. Custom metrics form will be displayed as a modal when the Edit Metrics option is clicked in #208977 (comment 336174090).
However, the form reloads upon submitting. The backend doesn't seem to allow XMLHttpRequest from the browser (Axios) i.e. form submit without page reload.
This issue will focus on enabling the API to allow processing such requests.