Added support for post types other then post and also added 404 support