Refactor this into a method, all functions return a `Json.obj` with `status`