correct 404 header
made method declaration more flexible
added separate handling for POST requests