Cowboy handler

I think it can be done with less code and without exceptions since they are not needed in this case. You can already answer to the request instead of throwing the exception to after send the reply. I will code so that you can compare it.