Add some checks
Set http status