What is a best practice for REST API response structure and layout?
Example of scrath:
Success response:
{
"status": "success",
"data": # some data here
}
Fail response:
{
"status": "fail",
"data": {
"code": # some error code,
"message": # some error explaining message
}
}