Rails Api Error Handling In Java