Updates for Tobias' comments. Added key checking to the REST API.