The success/failure of a api call should depend on the status code returned by the view, not the response body. The response body should be for informational purposes only. Example: delKey and toggleKey Javascript needs to by adapted