/**
  * Remove the specified resource from storage.
  * DELETE /credentials/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     // TODO: refactor into a provider?
     if (Credential::find($id) != null) {
         Credential::find($id)->delete();
         return Response::json(array('code' => 200, 'message' => 'ok'), 200);
     }
     return Response::json(array('code' => 401, 'message' => 'the requested resource was not found'), 401);
 }